package com.geek.boot3vue.controller;

import com.geek.boot3vue.entity.User;
import com.geek.boot3vue.result.Result;
import com.geek.boot3vue.service.UserService;
import com.geek.boot3vue.entity.User;
import com.geek.boot3vue.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author chenmin
 * @desc TODO
 * @date 2025/9/11
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping
    public Result list(){
        List<User> list = userService.list();
        if(!CollectionUtils.isEmpty(list)){
            return new Result(true , "查询用户列表成功" , list);
        }
        return new Result(false , "查询用户列表失败");
    }

}
